package com.syncshot.androidapp.activities;

import android.app.Activity;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.view.View;
import android.view.Window;

import com.syncshot.androidapp.R;

public abstract class AbstractActivity extends Activity {

    public void onClickGalery(View view) {
        startActivity(new Intent(this, GaleryActivity.class));
    }

    public void onClickShare(View view) {
        try {
            Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("text/plain");
            intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.share_subject));
            String message = getString(R.string.share_appli);
            intent.putExtra(Intent.EXTRA_TEXT, new StringBuilder().append(message).toString());
            startActivity(Intent.createChooser(intent, getString(R.string.general_share_through)));
        } catch (Exception e) {
        }
    }

    public void onClickHome(View view) {
        startActivity(new Intent(this, HomeActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK));
    }


    @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        Window window = getWindow();
        window.setFormat(PixelFormat.RGBA_8888);
    }
}
